﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication12
{
    class Program
    {
        static void Main(string[] args)
        {
            string ch;
            do
            {
                Console.WriteLine("Enter the number from 1 to 8 to chose task");
                int variant = Int32.Parse(Console.ReadLine());
                switch (variant)
                {
                    case 1:
                        DoFirstTask();
                        break;
                    case 2:
                        DoSecondTask();
                        break;
                    case 3:
                        DoThirdTask();
                        break;
                    case 4:
                        DoFourthTask();
                        break;
                    case 5:
                        DoFifthTask();
                        break;
                    case 6:
                        DoSixthTask();
                        break;
                    case 7:
                        DoSeventhTask();
                        break;
                    case 8:
                        DoEightsTask();
                        break;
                    default:
                        Console.WriteLine("Wrong number");
                        Console.ReadKey();
                        break;
                }
                Console.WriteLine("Press Y to continue");
                ch = Console.ReadLine();
                ch = ch.ToLower();
                Console.Clear();
            }
            while (ch == "y");


        }
        static void DoFirstTask()
        {
            int a = 0;
            int i;
            {
                for (i = 10; i <= 100; i++)
                {
                    a = i % 5;
                    if (a == 0)
                    {
                        Console.WriteLine("The number which is divides at 5 is {0}", i );
                    }
                }
            }
        }

        static void DoSecondTask()
        {
            Console.WriteLine("Enter the count of number");
            int N = Int32.Parse(Console.ReadLine());
            int numberNegative = 0;
            int numberPositive = 0;
            int numberZero = 0;
            do
            {
                Console.WriteLine("Enter number");
                int number = Int32.Parse(Console.ReadLine());
                N--;
                if (number < 0)
                {
                    numberNegative++;
                }
                else if (number > 0)
                {
                    numberPositive++;
                }
                else
                {
                    numberZero++;
                }
            }
            while (N > 0);
            Console.WriteLine("Count of negative numbers is {0}", numberNegative);
            Console.WriteLine("Count of positive numbers is {0}", numberPositive);
            Console.WriteLine("Count of zerous is {0}", numberZero);
        }

        static void DoThirdTask()
        {
            Console.WriteLine("Enter the number");
            int number = Int32.Parse(Console.ReadLine());
            int b = 0;
            int numberCount = number;
            do
            {
                numberCount = numberCount / 10;
                b++;
            }
            while (numberCount > 0);
            Console.WriteLine("The count of numbers is {0}", b);
            Console.ReadKey();

            int numberLast;
            int maxNumber = 0;
            int minNumber = 9;
            int counter = 0;
            do
            {
                numberLast = number % 10;
                number = number / 10;
                counter++;
                if (numberLast > maxNumber)
                {
                    maxNumber = numberLast;
                }
                if (numberLast <= minNumber)
                {
                    minNumber = numberLast;
                }
            }
            while (number > 0);
            Console.WriteLine("The max number is {0}, the min number is {1}", maxNumber, minNumber);
            Console.ReadKey();
        }

        static void DoFourthTask()
        {
            int numberSquare = 0;
            for (int i = 10; i <= 20; i++)
            {
                numberSquare = i * i;
                Console.WriteLine("The square numbers from 10 to 20 are: {0}",numberSquare);
            }
        }
        static void DoFifthTask()
        {
            Console.WriteLine("Enter five numbers");
            int numberMax = -2147483648;
            for (int i = 0; i < 5; i++)
            {
                int numberEntered = Int32.Parse(Console.ReadLine());
                if (numberMax < numberEntered)
                {
                    numberMax = numberEntered;
                }
            }
            Console.WriteLine("The biggest number is {0}", numberMax);
            Console.ReadKey();
        }
        static void DoSixthTask()
        {
            Console.WriteLine("Enter the quantity of money");
            double numberMoney = double.Parse(Console.ReadLine());
            Console.WriteLine("Enter the number of years");
            double numberYears = double.Parse(Console.ReadLine());
            double numberPercent = 0.03;
            double sumMoney = numberMoney;
         for (var i = 1; i <= numberYears; i++)
            {
                sumMoney = (sumMoney* numberPercent)+sumMoney;
            }
            Console.WriteLine("Your profit in entered number of years is {0}", sumMoney);
            Console.ReadKey();
        }

            static void DoSeventhTask()
          {
                int resultOfDividingAtFive = 0;
                int resultOfDividingAtThree = 0;
                int i;
                {
                    for (i = 20; i <= 50; i++)
                    {
                        resultOfDividingAtFive = i % 5;
                        resultOfDividingAtThree = i % 3;
                        if (resultOfDividingAtFive != 0 && resultOfDividingAtThree == 0)
                        {
                            Console.WriteLine("The number which divides at 3 and doesn't divide at 5 is {0}", i);
                        }
                    }
                Console.ReadKey();
                }
            }
        static void DoEightsTask()
        {
            int numberAmebas = 1;
            for (int i = 3; i <= 24; i = i + 3)
            {
                numberAmebas = numberAmebas * 2;
                Console.WriteLine("The number of amebas in {0} hours is {1}", i, numberAmebas);
            }
            Console.ReadKey();
        }
    }   
    }
